<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Set"%>
<%@page import="org.mcavallo.opencloud.Tag"%>
<%@page import="com.taobao.askwho.utils.CloudTagUtils"%>
<%@page import="com.taobao.askwho.utils.WorldPressCloudTagUtils"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="快速找到解决问题的人或资料的网站">
<meta name="author" content="zhongting.zy">

<title>问谁-去记录，去分享，去收藏</title>
<script type="text/javascript">
	var base = "<%=request.getContextPath()%>";
</script>
<!-- Le styles -->
<link href="<%=request.getContextPath()%>/assets/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
	padding-top: 60px;
	padding-bottom: 40px;
}
</style>
<link href="<%= request.getContextPath()%>/assets/css/bootstrap-responsive.css" rel="stylesheet">

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<%= request.getContextPath()%>/assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="<%= request.getContextPath()%>/assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="<%= request.getContextPath()%>/assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="<%= request.getContextPath()%>/assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="<%= request.getContextPath()%>/assets/ico/apple-touch-icon-57-precomposed.png">
         <link rel="stylesheet" type="text/css"
          href="<%=request.getContextPath()%>/assets/css/opencloud.css"/>
   <link rel="stylesheet" type="text/css"
          href="<%= request.getContextPath()%>/assets/css/dailymotion.css"/>

</head>


<body>
	<%@include file="/jsp/header.jsp"%>
	<div class="container">
		<div>
			<div id="main">
				<div class="post" id="post-111">
					<h1>热门收藏-标签云</h1>
					<hr/>
					<div class="content">
						<%
							String frameUrl = "index.jsp";
							List<WorldPressCloudTagUtils.CloudTagPo> cloudList = (List<WorldPressCloudTagUtils.CloudTagPo>) request
									.getAttribute("cloudTags");
							if (cloudList == null) {
								out.println("没有数据");
							} else {
								for (WorldPressCloudTagUtils.CloudTagPo po : cloudList) {
						%>
						<a
							href='<%=request.getContextPath()%>/urljump.do?method=searchMain&keyword=<%=po.getTitle()%>'
							class='<%=po.getLinkCss()%>' title='<%=po.getValue()%>'
							style='<%=po.getStyle()%>'><%=po.getTitle()%></a>&nbsp;&nbsp;
						<%
							}
							}
						%>
					</div>
					<br/>
				</div>
			</div>
		</div>
		<br>
		<br>
		<div>
			<form class="well form-search" action="<%=request.getContextPath()%>/urljump.do" method="get">
			<table>
				<tr>
					<td ><input type="text" class="input-superlarge search-query" placeholder="去记录，去分享，去收藏......" name="keyword" id="keyword1"></td>
					<td ><button type="submit" class="btn">查询</button>&nbsp;&nbsp;
					<a class="btn btn-small btn-link" data-toggle="modal" href="#myModal" >查询技巧</a>
					</td>
				</tr>
			</table>
			<input type="hidden" name="method" value="searchMain">
			</form>
		</div>
			<!-- 弹出窗口默认560px，现改为640px -->
			<div class="modal hide fade" id="myModal" style="width: 600px;">
			  <div class="modal-header">
			    <button type="button" class="close" data-dismiss="modal">×</button>
			    <h3>问谁的搜索秘诀</h3>
			  </div>
			  <div class="modal-body">
			     问谁内部采用solr做搜索引擎，支持中英文分词，可以像传统搜索引擎一样搜素<br/>
			  1.查人时输入person，查资料时输入url。如:detail person 或是 bootstrap url<br/>
			  2.建议用空格或逗号分割搜索词。如 detail person 或是 detail,person<br/>
			  3.默认显示前100条记录。<br/>
			  </div>
			 </div>		
		<hr>
		<%@include file="/jsp/footer.jsp" %>

	</div>
	<!-- /container -->

	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="<%= request.getContextPath()%>/assets/js/jquery.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-transition.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-alert.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-modal.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-dropdown.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-scrollspy.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-tab.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-tooltip.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-popover.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-button.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-collapse.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-carousel.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/bootstrap-typeahead.js"></script>
    <script type="text/javascript" src="<%= request.getContextPath()%>/assets/others/tokeninput/src/jquery.tokeninput.js"></script>
	<script src="<%= request.getContextPath()%>/assets/js/auto_main.js"></script>
    <!-- jquery ui -->
    <link href="<%=request.getContextPath()%>/assets/css/jquery-ui-1.8.18.custom.css" rel="stylesheet">
    <script src="<%= request.getContextPath()%>/assets/js/jquery-ui-1.8.18.custom.min.js"></script>
    <!-- autocomplete -->
    <script src="<%=request.getContextPath()%>/assets/js/jquery.ui.core.js"></script>
    <script src="<%=request.getContextPath()%>/assets/js/jquery.ui.widget.js"></script>
    <script src="<%=request.getContextPath()%>/assets/js/jquery.ui.position.js"></script>
    <script src="<%=request.getContextPath()%>/assets/js/jquery.ui.autocomplete.js"></script>

    <script type="text/javascript">
        $(function () {
            //autocomplete插件
            //缓存
            var cache = {};
            $("#keyword1").autocomplete({
                source:function (request, response) {
                    var term = request.term;
                    if (term in cache) {
                        response($.map(cache[ term ], function (item) {
                            return {
                                value:item.tagName
                            }
                        }));
                        return;
                    }
                    $.ajax({
                        url:"tagopt.do?method=tagAutoCompleted",
                        dataType:"json",
                        data:{
                            q:request.term
                        },
                        success:function (data) {
                            cache[ term ] = data;
                            response($.map(data, function (item) {
                                return {
                                    value:item.tagName
                                }
                            }));
                        }
                    });
                },
                minLength:0,
                select:function (event, ui) {
                    $("#keyword").val(ui.item.tagName);
                }
            });
            
			$('#myTab').click(function (e) {
				alert("sss");
				  e.preventDefault();
				  $(this).tab('show');
			})            
        })
    </script>
</body>
</html>
